home *** CD-ROM | disk | FTP | other *** search
/ Corel Draw! Unleashed / Corel Draw! Unleashed.iso / wincim / scripts.lib / CONNECT.SCR next >
Encoding:
Text File  |  1993-05-14  |  6.3 KB  |  297 lines

  1. !
  2. !  Copyright (c) 1993
  3. !  by CompuServe Incorporated, Columbus, Ohio
  4. !
  5. !  The information in this software is subject to change without
  6. !  notice and should not be construed as a commitment by CompuServe.
  7. !
  8. !  CONNECT:
  9. !    Handles CompuServe and Direct.
  10. !
  11. !  NOTE:  It is recommended that the numeric codes for networks NOT be
  12. !    modified since other utility programs may assume the relationships
  13. !    of network names and network ids specified below.
  14. !
  15. !+V
  16. ! "3.0"
  17. !-V
  18.  
  19. !+N
  20. CompuServe = 1;        ! "CompuServe"
  21. AlaskaNet = 20;        ! "AlaskaNet"
  22. CompuPass = 13;        ! "CompuPass"
  23. CSIRnet = 16;        ! "CSIR-Net"
  24. DataPac = 4;        ! "DataPac"
  25. Datex_J = 19;        ! "Datex-J"
  26. Datex_P = 10;        ! "Datex-P"
  27. FALNET = 14;        ! "FALNET"
  28. Dialplus = 11;        ! "GNS Dialplus"
  29. InfoNet_Europe = 5;    ! "InfoNet-Euro"
  30. InfoNet_World = 6;    ! "InfoNet-Wrld"
  31. ISRAKAV = 17;        ! "ISRAKAV"
  32. LATA = 7;        ! "LATA"
  33. CTLATA = 8;        ! "LATA-Ct"
  34. Mercury = 15;        ! "Mercury"
  35. NIF = 12;        ! "NIFTY LL"
  36. PacNet = 21;        ! "PacNet"
  37. Telenet = 2;        ! "SprintNet"
  38. Telepac = 9;        ! "Telepac"
  39. Transpac = 18;        ! "Transpac"
  40. TTNNet = 22;        ! "TTN-Net"
  41. Tymnet = 3;        ! "Tymnet"
  42. Direct = 23;    ! "Direct"
  43. !-N
  44.  
  45. define %CR = "^M";
  46. define %FALSE = 0;
  47. define %TRUE = 1;
  48. hangup = 1;
  49. UsingModem = %FALSE;
  50. CISNetwork = %FALSE;
  51.  
  52. !
  53. ! Main Program
  54. !
  55. init %Port, %BaudRate;
  56. if %_init goto Continue_Connect;
  57.  
  58. define %FailureMsg = "Could not initialize port";
  59. goto Connect_Fatal;
  60.  
  61. Continue_Connect:
  62.     call %Dir & "first.scr" () : Result;
  63.     if Result = %Cancel goto Cancel_Connect;
  64.     if Result = %Failure goto Connect_Failure;
  65.     if Result = %Fatal goto Connect_Fatal;
  66.  
  67.     on cancel goto Cancel_Connect;
  68.     DirectConnect = (%Network = Direct) or (%DialType = 2);
  69.     if DirectConnect goto Connect_CIS;
  70.  
  71.     call %Dir & "phone.scr" () : Result;
  72.  
  73.     if Result = %Cancel goto Cancel_Connect;
  74.     if Result = %Failure goto Connect_Failure;
  75.     if Result = %Fatal goto Connect_Fatal;
  76.  
  77.     UsingModem = %TRUE;
  78.  
  79.     if %Network = CompuServe goto Connect_CIS;
  80.     if %Network = Telenet goto Connect_Telenet;
  81.     if %Network = Tymnet goto Connect_Tymnet;
  82.     if %Network = DataPac goto Connect_DataPac;
  83.     if %Network = InfoNet_Europe goto Connect_InfoNet_Europe;
  84.     if %Network = InfoNet_World goto Connect_InfoNet_World;
  85.     if %Network = LATA goto Connect_LATA;
  86.     if %Network = CTLATA goto Connect_CTLATA;
  87.     if %Network = Telepac goto Connect_Telepac;
  88.     if %Network = Datex_P goto Connect_Datex_P;
  89.     if %Network = Datex_J goto Connect_Datex_J;
  90.     if %Network = Dialplus goto Connect_Dialplus;
  91.     if %Network = NIF goto Connect_NIF;
  92.     if %Network = CompuPass goto Connect_CompuPass;
  93.     if %Network = FALNET goto Connect_FALNET;
  94.     if %Network = Mercury goto Connect_Mercury;
  95.     if %Network = CSIRnet goto Connect_CSIRnet;
  96.     if %Network = ISRAKAV goto Connect_ISRAKAV;
  97.     if %Network = Transpac goto Connect_Transpac;
  98.     if %Network = AlaskaNet goto Connect_AlaskaNet;
  99.     if %Network = PacNet goto Connect_PacNet;
  100.     if %Network = TTNNet goto Connect_TTNNet;
  101.  
  102.     define %FailureMsg = "Network not supported";
  103.     goto Connect_Fatal;
  104.  
  105. !
  106. !  Connect to Telenet
  107. !
  108. Connect_Telenet:
  109.     call %Dir & "telenet.scr" () : Result;
  110.     goto Handle_Network_Return;
  111.  
  112. !
  113. !  Connect to Tymnet
  114. !
  115. Connect_Tymnet:
  116.     call %Dir & "tymnet.scr" (1) : Result;
  117.     goto Handle_Network_Return;
  118.  
  119. !
  120. !  Connect to DataPac
  121. !
  122. Connect_DataPac:
  123.     call %Dir & "datapac.scr" () : Result;
  124.     goto Handle_Network_Return;
  125.  
  126. !
  127. !  Connect to InfoNet Europe
  128. !
  129. Connect_InfoNet_Europe:
  130.     call %Dir & "infonet.scr" (%TRUE) : Result;
  131.     goto Handle_Network_Return;
  132.  
  133. !
  134. !  Connect to InfoNet World
  135. !
  136. Connect_InfoNet_World:
  137.     call %Dir & "infonet.scr" (%FALSE) : Result;
  138.     goto Handle_Network_Return;
  139.  
  140. !
  141. !  Connect to LATA
  142. !
  143. Connect_LATA:
  144.     call %Dir & "lata.scr" (%TRUE) : Result;
  145.     goto Handle_Network_Return;
  146.  
  147. !
  148. !  Connect to Connecticut LATA
  149. !
  150. Connect_CTLATA:
  151.     call %Dir & "lata.scr" (%FALSE) : Result;
  152.     goto Handle_Network_Return;
  153.  
  154. !
  155. !  Connect to Telepac
  156. !
  157. Connect_Telepac:
  158.     call %Dir & "telepac.scr" () : Result;
  159.     goto Handle_Network_Return;
  160.  
  161. !
  162. !  Connect to Datex-P
  163. !
  164. Connect_Datex_P:
  165.     call %Dir & "datexp.scr" () : Result;
  166.     goto Handle_Network_Return;
  167.  
  168. !
  169. !  Connect to Datex-J
  170. !
  171. Connect_Datex_J:
  172.     call %Dir & "datexj.scr" () : Result;
  173.     goto Handle_Network_Return;
  174.  
  175. !
  176. !  Connect to Dialplus
  177. !
  178. Connect_Dialplus:
  179.     call %Dir & "dialplus.scr" () : Result;
  180.     goto Handle_Network_Return;
  181.  
  182. !
  183. !  Connect to NIF
  184. !
  185. Connect_NIF:
  186.     call %Dir & "fenics.scr" (%TRUE) : Result;
  187.     goto Handle_Network_Return;
  188.  
  189. !
  190. !  Connect to CompuPass
  191. !
  192. Connect_CompuPass:
  193.     call %Dir & "fenics.scr" (%FALSE) : Result;
  194.     goto Handle_Network_Return;
  195.  
  196. !
  197. !  Connect to FALNET
  198. !
  199. Connect_FALNET:
  200.     call %Dir & "falnet.scr" (%FALSE) : Result;
  201.     goto Handle_Network_Return;
  202.  
  203. !
  204. !  Connect to Mercury
  205. !
  206. Connect_Mercury:
  207.     call %Dir & "mercury.scr" () : Result;
  208.     goto Handle_Network_Return;
  209.  
  210. !
  211. !  Connect to CSIR-Net
  212. !
  213. Connect_CSIRnet:
  214.     call %Dir & "csirnet.scr" () : Result;
  215.     goto Handle_Network_Return;
  216.  
  217. !
  218. !  Connect to ISRAKAV
  219. !
  220. Connect_ISRAKAV:
  221.     call %Dir & "israkav.scr" () : Result;
  222.     goto Handle_Network_Return;
  223.  
  224. !
  225. !  Connect to Transpac
  226. !
  227. Connect_Transpac:
  228.     call %Dir & "transpac.scr" () : Result;
  229.     goto Handle_Network_Return;
  230.  
  231. !
  232. !  Connect to AlaskaNet
  233. !
  234. Connect_AlaskaNet:
  235.     call %Dir & "tymnet.scr" (2) : Result;
  236.     goto Handle_Network_Return;
  237.  
  238. !
  239. !  Connect to PacNet
  240. !
  241. Connect_PacNet:
  242.     call %Dir & "tymnet.scr" (3) : Result;
  243.     goto Handle_Network_Return;
  244.  
  245. !
  246. !  Connect to TTN-Net
  247. !
  248. Connect_TTNNet:
  249.     call %Dir & "ttnnet.scr" (3) : Result;
  250.     goto Handle_Network_Return;
  251.  
  252. !
  253. !  Handle Network Return
  254. !
  255. Handle_Network_Return:
  256.     if Result = %Success goto Do_CIS_Script;
  257.     if Result = %Cancel goto Cancel_Connect;
  258.     if Result = %Fatal goto Connect_Fatal;
  259.     goto Connect_Failure;
  260.  
  261. !
  262. !  Connect to CIS
  263. !
  264. Connect_CIS:
  265.     CISNetwork = %TRUE;
  266.     send %CR;
  267.  
  268. Do_CIS_Script:
  269.     call %Dir & "cserve.scr" (DirectConnect, CISNetwork) : Result;
  270.     if Result = %Failure goto Connect_Failure;
  271.     if Result = %Cancel goto Cancel_Connect;
  272.     if Result = %Fatal goto Connect_Fatal;
  273.     exit %Success;
  274.  
  275. Connect_Failure:
  276.     gosub Hangup_Connect;
  277.     reset;
  278.     exit %Failure;
  279.  
  280. Connect_Fatal:
  281.     gosub Hangup_Connect;
  282.     reset;
  283.     exit %Fatal;
  284.  
  285. Hangup_Connect:
  286.     if not UsingModem goto Hangup_Done;
  287.     ifndef %LOCAL = 1;
  288.     call %Dir & "disconct.scr" ();
  289. Hangup_Done:
  290.     return;
  291.  
  292. Cancel_Connect:
  293.     show "Connect cancelled";
  294.     gosub Hangup_Connect;
  295.     reset;
  296.     exit %Cancel;
  297.